package com.ben.multiple.aop.rest;

import com.ben.multiple.aop.annotation.TestAnnotation3;
import com.ben.multiple.aop.annotation.TestAnnotation4;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author BenJin Yin
 * @date 2020/8/26
 */
@RestController
@RequestMapping("/nine")
@AllArgsConstructor
@Slf4j
public class NineRest {
    @TestAnnotation3(value = "方法级注解 a")
    @GetMapping("/a")
    public String a() {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("NineRest  a");
        return "hello world a ";
    }

    @TestAnnotation4(value = "方法级注解 b")
    @GetMapping("/b")
    public String b() {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("NineRest  b");
        return "hello world b";
    }
}
